import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);

const state = {
  loading: false, //页面加载状态
  navOpacity: 0.9, //首页导航透明度
  tabStatus: -1, //二级导航状态
};
const mutations = {
  // 改变页面加载状态
  changeLoading(state, status) {
    state.loading = status;
  },
  // 首页导航透明度
  changeOpacity(state, status) {
    state.navOpacity = status;
  },
  // 获取当前二级导航下标
  getTab(state, status) {
    state.tabStatus = status;
  },
};

const getters = {};

export default new Vuex.Store({
  state,
  mutations,
  getters,
});
